package com.yidu.GlobalManagement.log.mapper;

import com.yidu.GlobalManagement.log.entity.SysLog;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @author 任俊杰
 * @version 1.0
 * @date 2022/12/15
 */
@Mapper
public interface SysLogMapper {

    /**
     * 日志查询
     * @param map 集合
     * @return list 集合
     */
    @Select("select * from log  order by logId limit #{page},#{limit}")
    List<SysLog> selectLog(Map map);

    /**
     * 分页查行数 模糊查询后的行数 根据条件
     * @param map
     * @return
     */
    @Select("select count(*) from log where 1=1 ${sqlWhere}")
    int selectCount(Map map);

    /**
     * 日志新增
     * @param sysLog 日志对象
     * @return int i 受影响的行数
     */
    @Insert("insert into log(logByTime,logByUser,logByUrl,logByRunTime,logByClass,logByRunName) values(#{logByTime},#{logByUser},#{logByUrl},#{logByRunTime},#{logByClass},#{logByRunName})")
    public int addSysLog(SysLog sysLog);

}
